Skip to content

test: cover isTauriRuntime desktop vs browser markers (#53) - #58

Merged
McanKul merged 1 commit into
McanKul:developmentfrom
nonamexishere:feat/53-tauri-runtime-detection
Aug 26, 2026
Merged

test: cover isTauriRuntime desktop vs browser markers (#53)#58
McanKul merged 1 commit into
McanKul:developmentfrom
nonamexishere:feat/53-tauri-runtime-detection

Conversation

@nonamexishere

Copy link
Copy Markdown
Contributor

Summary

Adds unit coverage for isTauriRuntime() (#53). Tests install and restore controlled window markers so they do not need a live Tauri window.

  • false when window is unavailable
  • false on a browser-like window with no Tauri markers
  • true for __TAURI_INTERNALS__, __TAURI__, and isTauri each on their own
  • falsey marker values do not count as a desktop runtime
  • each case restores global state

Production src/lib/tauriEnv.ts is unchanged.

This is independent of #54 / #55.

Fixes #53.

Validation

  • npm test (186, including 7 new)
  • npm run typecheck
  • cargo test --manifest-path src-tauri/Cargo.toml --lib (97)

Privacy Checklist

  • This keeps OffPDF usable offline.
  • This does not upload, log, or transmit user files.
  • New dependencies or bundled binaries have compatible licenses.

Lock false when window is missing or unmarked, true for each Tauri
marker on its own, and no false positive from falsey values.
Fixes McanKul#53.

@McanKul McanKul left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — this is focused, deterministic coverage and keeps production behavior unchanged.

@McanKul
McanKul merged commit e0529cc into McanKul:development Aug 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants